<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8" />
    <title>speedy管理系统-登录页面</title>
</head>
<script src="/static/public/js/jquery.js"></script>
<link href="/static/public/css/public.css" rel="stylesheet" type="text/css" />
<link href="/static/public/bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css" />
<style>
body{font-size:16px;background:#cce5ef;}
.box{position:fixed;background:url(/static/images/loginBgk.png) no-repeat;background-position:20% center; height:100%;width:100%;z-index:-1;}
.loginbox{min-width:370px; position:fixed;width:25%;height:260px;background:#fff;right:100px;top:25%;box-shadow:5px 5px 5px #999;}
.loginbox h2{margin:20px;color:#2f3f51;text-align: center}
.loginbox ul{list-style:none;width:80%;margin:0 auto;}
.loginbox ul li{height:20%;font-size:16px;margin-top:20px;}
.loginbox ul li span{margin-right:10px;}
.loginbox ul li input{width:80%;height:30px;background:#fff;outline: none}
.loginbox .btns{width:80%;margin:20px auto;}
.loginbox .btns .btn{width:100%;}
</style>
<body>
<div class="box">
	<div class="loginbox">
		<h2>speedy管理系统</h2>
		<hr />
		<ul>
			<li>
				<span>账号:</span><input type="text" id="account" name="account" value="1"/>
			</li>
			<li>
				<span>密码:</span><input type="password" id="password" name="password" value="1"/>
			</li>
		</ul>
		<div class="btns">
			<button class="btn btn-info" id="login">登录</button>
		</div>
	</div>
</div>
<script src="/static/public/js/Alert.js"></script>
<script>
	$(document).ready(function(){
		if(window.top!=window.self){
			window.parent.location.href="/common/login";
		}
		$("#login").bind("click",function(){
			var account=$("#account").val();
			var password=$("#password").val();
			if(account==""){
				Alert.hint("账号不能为空");
				return;
			}else if(password==""){
				Alert.hint("密码不能为空");
				return;
			}else{
				$.post("/common/login/login",{"account":account,"password":password},function(res){
					if(res.state==1){
						Alert.hint("登录成功，即将跳转");
						setTimeout(function(){
							window.location.href="/common/main/toPage?page=main";
						},2000)
					}else{
						Alert.hint(res.message);
					}
				})
				
			}
		})
	})
</script>
</body>
</html>